/**
* component: Attachment
* prefix: .mui-attachment
*/
.mui-attachment {
  display: inline-block;
  width: 317px;
  border: solid 1px #eaeaea;
  border-radius: 4px;

  & > .mui-attachment-viewer {
    height: 200px;
    border-bottom: solid 1px #eaeaea;
    background-color: #f5f5f5;
    position: relative;
    text-align: center;
    &:after {
      content: '';
      display: inline-block;
      width: 0;
      height: 200px;
      vertical-align: middle;
    }

    img {
      display: inline-block;
      max-width: 100%;
      max-height: 100%;
      vertical-align: middle;
    }

    & > .mui-attachment-viewer-upload {
      padding: 80px 0;
      cursor: pointer;
      font-size: 15px;
      text-align: center;
      line-height: 40px;
      color: #99f; // 主题色
    }

    & > .mui-attachment-viewer-mask {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      border-radius: 4px 4px 0 0;
      display: none;

      & > .mui-attachment-toolbar {
        position: absolute;
        right: 16px;
        bottom: 16px;

        & > button {
          border: none;
          background-color: #fff;
          border-radius: 3px;
          padding: 2px 8px;
          font-size: 16px;
          color: #999;
          margin-left: 10px;
          outline: none;
          cursor: pointer;

          &.mui-attachment-btn-view:hover {
            color: #99f;
          }

          &.mui-attachment-btn-delete:hover {
            color: #fd423e;
          }
        }
      }
    }
    &:hover > .mui-attachment-viewer-mask {
      display: block;
    }
  }

  & > .mui-attachment-info {
    height: 70px;
    padding: 8px 16px;
    box-sizing: border-box;
    background-color: #fff;

    & > .mui-attachment-info-name {
      height: 30px;
      display: flex;
      & > span {
        display: block;
        flex: 1;
        font-size: 13px;
        line-height: 30px;
        color: #333;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
      & > .Icon {
        display: block;
        width: 30px;
        height: 30px;
        font-size: 16px;
        line-height: 30px;
        text-align: center;
        color: #666;
        cursor: pointer;
        &:hover {
          color: #333;
        }
      }
      & > .mui-textinput {
        font-size: 13px;
        line-height: 20px;
        padding: 4px 10px;
        width: 100%;
      }
    }

    & > .mui-attachment-info-info {
      height: 24px;
      font-size: 13px;
      line-height: 24px;
      color: #9e9e9e;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
}
